//
//  NSDictionary+BYDic.m
//  ZhiHuiLiJiang
//
//  Created by 胡忠诚 on 2018/11/21.
//  Copyright © 2018 WisdomLijiang. All rights reserved.
//

#import "NSDictionary+BYDic.h"

@implementation NSDictionary (BYDic)
- (NSString *)jsonStringEncoded {//字典转json
    if ([NSJSONSerialization isValidJSONObject:self]) {
        NSError *error;
        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:0 error:&error];
        NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
        if (!error) return json;
    }
    return nil;
}



@end
